import {Node} from '.'
export interface Context {
	config: Config
	lazyLoad: (
	    node?: Node,
	    cb?: (dataList: Option[]) => void
	  ) => void
}

export type NodeValue = string | number
export type NodePathValue = NodeValue[]


export interface Option extends Record<string, unknown> {
	label?: string
	value?: NodeValue
	children?: Option[]
	disabled?: boolean
}

export type Resolve = (dataList?: Option[]) => void

export interface Props {
	multiple?: boolean
	emitPath?: boolean
	lazy?: boolean
	lazyLoad?: Context['lazyLoad']
	value?: string
	label?: string
	children?: string
	disabled?: ((data:Option,t:any) => boolean)|string
}


export type Config = Required<Props>

export type Nullable<T> = null | T